<template>
    <div class="evacuateOfScene">
        <img src="../../assets/img/evacuateOfScene.png" alt="">
        <h3>请立即撤离现场</h3>
        <p class="p16" v-html="text"></p>
        <div class="footer">
            <p class="p12">未及时撤离现场造成交通拥堵，交警将予以处罚</p><br>
            <mu-container class="button-wrapper">
                <mu-button @click="goOut" color="#6794F5" full-width>已撤离</mu-button>
            </mu-container>
        </div>
    </div>
</template>
<script>
import {http} from 'utils/request.js';
import api from '../../api/index.js';
export default {
    name:"evacuateOfScene",
    data() {
        return {
            text: ''
        }
    },
    methods: {
        goOut() {
            const accidentNo = this.$route.query.accidentNo;
            let routeName = '';
            this.$route.query.fromPage == 'accidentPic'?routeName = "supplement":routeName = "intelligentResult";
            //保存B方信息
            http.post(api.API_SAVE_OUT,{
                accidentNo:accidentNo
            }).then(((res) => {
                if(res.code==1) {
                    this.$router.push({
                        name: routeName,
                        query: {
                            accidentNo: accidentNo, //事故编号
                            fromPage: this.$route.query.fromPage
                        }
                    });
                } else {
                    this.$toast.message({
                         message: res.message||"网络异常，请稍后再试",
                         color: '#F57979'
                    });
                }
            })).catch((error) =>{
                console.log(error);
            });
        }
    },
    created() {
      //修改title
      document.title = '撤离提示';
      
      let text1 = '请把车辆移至安全区域后补充信息，交警将<br />远程定责';
      let text2 = '请将车辆移至安全区域后查看智能责任校验<br />结果并完善信息';
      this.$route.query.fromPage == 'accidentPic'?this.text = text1:this.text = text2;
      console.log(this.$route.query.fromPage);
    },
    mounted() {

    }
}
</script>

<style lang="scss" scoped>
@import "~assets/css/mixin.scss";
    .evacuateOfScene {
        display: flex;
        flex-flow: column wrap;
        align-items: center;
        width: 100%;
        height: 100%;
        text-align: center;
        img{
            margin: 0.6rem 0 0 0;
            width: 1.5rem;
            height: 1.5rem;
        }
        h3 {
            font-size: 0.2rem;
            line-height: 0.6rem;
            color: #555;
        }
        .footer{
            width: 92%;
            margin: 0 auto rem(50);
        }
    }
    p {
        /* font-size: 0.16rem; */
        color: #8D9093;
    }
    .p16 {
        font-size: 0.16rem;
        flex: 1;
    }
    .p12 {
        font-size: 0.12rem;
        display: block;
        margin-bottom: rem(20);
    }
</style>

